﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Office.Interop.PowerPoint;
using Microsoft.Office.Core;
using System.IO;

namespace ClassRoomServer
{
    public partial class FrmMain : Form
    {
        PolicyServer policyServer = new PolicyServer("clientaccesspolicy.xml");
        MessengerServer messengerServer = new MessengerServer();

        public FrmMain()
        {
            InitializeComponent();            
        }

        private void btnStart_Click(object sender, EventArgs e)
        {
            policyServer.Start();

            messengerServer.Start();
            messengerServer.OnDeliverMessage += new MessengerServer.dlgDeliverMessage(messengerServer_OnDeliverMessage);

            this.tssServerStatus.Text = "Started";
        }        

        private void btnStop_Click(object sender, EventArgs e)
        {
            messengerServer.Stop();
            policyServer.Stop();
        }

        private void messengerServer_OnDeliverMessage(string message)
        {
            this.Invoke((MethodInvoker)delegate
            {

            });
        }
    }
}
